<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>UCARPP: includes/stm.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">UCARPP
   &#160;<span id="projectnumber">1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('stm_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">includes/stm.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="stm_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef STM_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define STM_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;stdbool.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &quot;<a class="code" href="solution_8h.html">solution.h</a>&quot;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &quot;<a class="code" href="graph_8h.html">graph.h</a>&quot;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="tabooState_8h.html">tabooState.h</a>&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="los_8h.html">los.h</a>&quot;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &quot;<a class="code" href="vectorParam_8h.html">vectorParam.h</a>&quot;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;<a class="code" href="ALGConfiguration_8h.html">ALGConfiguration.h</a>&quot;</span>
<a name="l00023"></a>00023 
<a name="l00030"></a><a class="code" href="stm_8h.html#ac636356a6ac19baf859b49ce5f43462d">00030</a> <span class="preprocessor">#define STM_MOVES_AVAILABLE 3</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="comment">//TODO rimuovere pictures!!!</span>
<a name="l00033"></a><a class="code" href="stm_8h.html#a9466a2472598c6447552953c6d447837">00033</a> <span class="preprocessor">#define STM_PICTURE_PATTERNNAME &quot;../pictures/solution%04lu.bmp&quot;</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a><a class="code" href="stm_8h.html#aaa23dc564dd37d24ddcede100f5055d6">00035</a> <span class="preprocessor">#define STM_MATLAB_F_OBJ_HISTORY &quot;../matlab-interface/fObjHistory.m&quot;</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span>
<a name="l00037"></a><a class="code" href="stm_8h.html#af0bd1d45304b9c0fc164d421867df852">00037</a> <span class="preprocessor">#define STM_MATLAB_MOVES_HISTORY &quot;../matlab-interface/movesHistory.m&quot;</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a><a class="code" href="stm_8h.html#ab97e6c58ff5e9aed2a0c5825840f09de">00039</a> <span class="preprocessor">#define STM_LOGFILE &quot;../pictures/stm.log&quot;</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00042"></a><a class="code" href="structSTMConfiguration.html">00042</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structSTMConfiguration.html">STMConfiguration</a> {
<a name="l00043"></a>00043 
<a name="l00046"></a><a class="code" href="structSTMConfiguration.html#a1c43fbc213d7e694f7121248abfbbc22">00046</a>         <span class="keywordtype">bool</span> <a class="code" href="structSTMConfiguration.html#a1c43fbc213d7e694f7121248abfbbc22">drawSolutionBMP</a>;
<a name="l00049"></a><a class="code" href="structSTMConfiguration.html#a99b340e8f7301cc408ba468fef044e73">00049</a>         <span class="keywordtype">bool</span> <a class="code" href="structSTMConfiguration.html#a99b340e8f7301cc408ba468fef044e73">drawSolutionOctave</a>;
<a name="l00051"></a><a class="code" href="structSTMConfiguration.html#a865a3b610e20a1378014f5158a17c02b">00051</a>         <span class="keywordtype">int</span> <a class="code" href="structSTMConfiguration.html#a865a3b610e20a1378014f5158a17c02b">maximumLOSIterationNumber</a>;
<a name="l00054"></a><a class="code" href="structSTMConfiguration.html#a27a004f561d2ab18036bd901e9cf2f0d">00054</a>         <span class="keywordtype">int</span> <a class="code" href="structSTMConfiguration.html#a27a004f561d2ab18036bd901e9cf2f0d">maximumLOSWorseningIterationNumber</a>;
<a name="l00055"></a>00055 
<a name="l00056"></a><a class="code" href="structSTMConfiguration.html#a68823cf5c92405792555dfded1a61b98">00056</a>         <a class="code" href="structLOSConfiguration.html">pLOSConfiguration</a> <a class="code" href="structSTMConfiguration.html#a68823cf5c92405792555dfded1a61b98">pLOSconfig</a>;
<a name="l00057"></a>00057 } <a class="code" href="stm_8h.html#a89c5978f28153dcb2e6b41579cb8f581">STMConfiguration</a>;
<a name="l00058"></a>00058 
<a name="l00059"></a><a class="code" href="stm_8h.html#abfde69eca527c83c96e2b8c1a9f7b2f3">00059</a> <span class="keyword">typedef</span> <a class="code" href="structSTMConfiguration.html">STMConfiguration</a>* <a class="code" href="stm_8h.html#abfde69eca527c83c96e2b8c1a9f7b2f3">pSTMConfiguration</a>;
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 <span class="comment">//TODO documentazione</span>
<a name="l00062"></a>00062 <a class="code" href="structSTMConfiguration.html">pSTMConfiguration</a> <a class="code" href="stm_8h.html#af3abf45e46715b683ca87f367e6d3a80">initSTMConfiguration</a>(<a class="code" href="structALGConfiguration.html">PalgConfiguration</a> pALGconfig);
<a name="l00063"></a>00063 
<a name="l00064"></a>00064 <span class="comment">//TODO PAT serve anche un freeSTMCOnfiguration per evitare il memoryleak dell&#39;applicazione!</span>
<a name="l00065"></a>00065 
<a name="l00066"></a>00066 <span class="comment">//TODO ragionare su questa taboolist... non sono sicuro che serva davvero!</span>
<a name="l00067"></a>00067 <span class="comment">//TODO forse sarebbe bello creare una struttura che gestisca appostiamente tale struttura... pero&#39; e&#39; soltanto una sottigliezza</span>
<a name="l00072"></a><a class="code" href="stm_8h.html#a4401c65b004c9ad672b791542078394b">00072</a> <span class="comment"></span><a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> <a class="code" href="stm_8h.html#a4401c65b004c9ad672b791542078394b">moveTabooList</a>[<a class="code" href="stm_8h.html#ac636356a6ac19baf859b49ce5f43462d" title="contiene le funzioni principali per realizzare la logica STM dell&#39;algoritmo">STM_MOVES_AVAILABLE</a>];
<a name="l00073"></a>00073 
<a name="l00079"></a><a class="code" href="stm_8h.html#ac96e415fff8f2850b88bc48de8299f88">00079</a> <span class="keywordtype">float</span> <a class="code" href="stm_8h.html#ac96e415fff8f2850b88bc48de8299f88">stmCovariance</a>[2][2];
<a name="l00080"></a>00080 
<a name="l00087"></a><a class="code" href="stm_8h.html#a12d20d7864c9f7fc6c5aa0f6232fa049">00087</a> <span class="keywordtype">float</span> <a class="code" href="stm_8h.html#a12d20d7864c9f7fc6c5aa0f6232fa049">stmCovarianceDet</a>;
<a name="l00088"></a>00088 
<a name="l00092"></a><a class="code" href="stm_8h.html#a09e90d00627ed328de25c613060553f5">00092</a> <span class="keywordtype">float</span> <a class="code" href="stm_8h.html#a09e90d00627ed328de25c613060553f5">stmCovarianceInv</a>[2][2];
<a name="l00093"></a>00093 
<a name="l00098"></a><a class="code" href="stm_8h.html#a908dc59a1ec4614c995d42b6d2e4057d">00098</a> <span class="keywordtype">float</span> <a class="code" href="stm_8h.html#a908dc59a1ec4614c995d42b6d2e4057d">stmGaussianAmplifier</a>;
<a name="l00099"></a>00099 
<a name="l00106"></a><a class="code" href="stm_8h.html#aa4a588571ef2f8a2d7736922ccec02a7">00106</a> <span class="keywordtype">float</span> <a class="code" href="stm_8h.html#aa4a588571ef2f8a2d7736922ccec02a7">stmGaussianLogBase</a>;
<a name="l00107"></a>00107 
<a name="l00111"></a><a class="code" href="stm_8h.html#af0505b5f436e4a28bafba72fadd7d8f1">00111</a> <span class="keywordtype">float</span> <a class="code" href="stm_8h.html#af0505b5f436e4a28bafba72fadd7d8f1">stmMinProbabilisticValue</a>;
<a name="l00112"></a>00112 
<a name="l00125"></a>00125 <span class="keywordtype">float</span> <a class="code" href="stm_8h.html#ab3e44f35fe4cc95ebb829415715b0c42">computeExponent</a>(<a class="code" href="structVectorParam.html">PvectorParam</a> v);
<a name="l00126"></a>00126 
<a name="l00145"></a>00145 <span class="keywordtype">float</span> <a class="code" href="stm_8h.html#ae822b5cfa2b5f240c74f8ca6087eeecd">computeGaussian</a>(<a class="code" href="structVectorParam.html">PvectorParam</a> x);
<a name="l00146"></a>00146 
<a name="l00164"></a>00164 <span class="keywordtype">void</span> <a class="code" href="stm_8h.html#a7d6e3933be190167160a5ef136426990">initSTMEngine</a>(<span class="keywordtype">int</span> T, <span class="keywordtype">int</span> Q);
<a name="l00165"></a>00165 
<a name="l00189"></a>00189 <a class="code" href="structSolution.html">Psolution</a> <a class="code" href="stm_8h.html#ad3881dbabe44ab983776e7f29adce370">executeSTM</a>(<a class="code" href="structSolution.html">Psolution</a> p_solution, <a class="code" href="structGraph.html">Pgraph</a> p_graph, <a class="code" href="structTabooState.html">PtabooState</a> p_taboostate,<span class="keywordtype">int</span>* totalIteration, <span class="keywordtype">int</span>* solutionintensity,<a class="code" href="structSTMConfiguration.html">pSTMConfiguration</a> pSTMconfig);
<a name="l00190"></a>00190 
<a name="l00202"></a>00202 <span class="keywordtype">bool</span> <a class="code" href="stm_8h.html#a590e5186e769add1a1b4b5b4e36882e0">stmMustContinue</a>(<a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> iterationNumber, <a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> maxIterationNumber, <a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> lastIncrementingIteration, <a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> maxContigousDecrementingIteration);
<a name="l00203"></a>00203 
<a name="l00219"></a>00219 <span class="keywordtype">int</span> <a class="code" href="stm_8h.html#af309f1cbea19eb7ad8f9e64db73766bf">selectBestLOSMove</a>(<a class="code" href="structVectorParam.html">PvectorParam</a> x, <a class="code" href="structVectorParam.html">PvectorParam</a> averageAdd, <a class="code" href="structVectorParam.html">PvectorParam</a> averageSwap, <a class="code" href="structVectorParam.html">PvectorParam</a> averageRemove);
<a name="l00220"></a>00220 
<a name="l00222"></a>00222 <span class="keywordtype">void</span> <a class="code" href="stm_8h.html#a864e876f10d23e40f552678494d7696a">initializeOutputScripts</a>(FILE** pfObjHistory, FILE** pmovesHistory, <span class="keywordtype">int</span> K, <span class="keywordtype">int</span> T, <span class="keywordtype">int</span> Q, <a class="code" href="structSolution.html">Psolution</a> ps);
<a name="l00224"></a>00224 <span class="keywordtype">void</span> <a class="code" href="stm_8h.html#ae0c84b467ad40d97e5ab749dddbf33bc">updateOutputScripts</a>(FILE* fObjHistory, FILE* movesHistory, <span class="keywordtype">int</span> k, <span class="keywordtype">int</span> T, <span class="keywordtype">int</span> Q, <span class="keywordtype">int</span> moveToApply, <span class="keywordtype">int</span> LOSExitStatus, <a class="code" href="structVehicleState.html">PvehicleState</a> pvs, <a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> currentIteration);
<a name="l00226"></a>00226 <span class="keywordtype">void</span> <a class="code" href="stm_8h.html#aed719c2c3b0ae1cd2a817925fa5d2ae4">finalizeOutputScripts</a>(FILE* fObjHistory, FILE* movesHistory, <span class="keywordtype">int</span> K, <a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> finalIteration);
<a name="l00227"></a>00227 
<a name="l00228"></a>00228 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="stm_8h.html">stm.h</a>      </li>

    <li class="footer">Generated on Wed Sep 4 2013 06:38:56 for UCARPP by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
